/**
 * Created by yqj on 2017/2/16.
 */
module.exports = {
    /**
     * 查询数据库
     * @param collectionName {string}
     * @param paload {object}
     */
    find (collectionName, paload) {
        console.log('payload:',paload)
        let model = require('../models/' + collectionName);
        model.find(paload.where, (error, data) => {
            if (error) {
                console.log(error);
            } else {
                Promise.resolve(data);
            }
        });
        return Promise.defer
    },
    update () {

    },
    remove () {

    },
    save () {

    }

};